//
//  CurrnecyExchaqngeLiquidityGmoList.m
//  DataCollector
//
//  Created by jiro on 12/07/10.
//  Copyright 2012 jiro music. All rights reserved.
//

#import "CurrencyExchangeLiquidityGmoList.h"

#import "CurrencyExchangeLiquidityGmo.h"

@implementation CurrnecyExchangeLiquidityGmoList

+ (CurrnecyExchangeLiquidityGmoList*) listWithPgresult: (PGresult*) res
{
	CurrnecyExchangeLiquidityGmoList* ret = [ [ CurrnecyExchangeLiquidityGmoList alloc ] init ];
	int row = PQntuples( res );
	int column = PQnfields( res );
	for ( int i = 0; i < row; i++ ) 
	{
		NSMutableArray* values = [ NSMutableArray array ];
		for ( int j = 0; j < column; j++ )
		{
			[ values addObject: [ NSString stringWithFormat: @"%s", PQgetvalue( res, i, j ) ] ];
		}
		CurrencyExchangeLiquidityGmo* type = [ CurrencyExchangeLiquidityGmo currencyExchangeLiquidityGmoWithValues: values ];
		[ ret addObject: type ];
	}
	return ret;
}

@end
